package com.app.twth.ui.main;


import com.app.twth.app.Constant;
import com.app.twth.base.BaseModel;
import com.app.twth.bean.BaseResponseEntity;
import com.app.twth.net.JsonCallBack;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.FileCallback;

import java.io.File;

public class MainDataModel extends BaseModel {
    //模拟登陆接口
    public <T> void getPermission(JsonCallBack jsonCallBack) {
        OkGo.<BaseResponseEntity<T>>get(Constant.permission)
                .tag(this)
                .execute(jsonCallBack);
    }
    public <T> void getNewAppInfo(JsonCallBack jsonCallBack) {
        OkGo.<BaseResponseEntity<T>>get(Constant.getNewAppInfo)
                .tag(this)
                .execute(jsonCallBack);
    }

    public void getApk(String url, FileCallback jsonCallBack) {
        OkGo.<File>get(url)
                .tag(this)
                .execute(jsonCallBack);
    }
    public <T>  void taskTips(JsonCallBack jsonCallBack) {
        OkGo.<BaseResponseEntity<T>>get(Constant.taskTips)
                .tag(this)
                .execute(jsonCallBack);
    }
}
